'use strict';
	angular.module('inventory.storageItemBatchQueryList', ['app.services'])

	.controller('storageItemBatchQueryListCtrl' ,['$rootScope', '$scope', 'BizData' , f])
    function f($rootScope, $scope, BizData) {

		var Model = this;
		
		var options = {};
		options.container = Model;
		options.concept = 'StorageItemBatch';
		options.name = 'dataMaster';
		options.url = $rootScope.path;
		options.httpUrl = $rootScope.getServiceName();
		options.reader = '/inventory/storageItemBatchQuery/list/query';
		options.writer = '';
		options.deleter = '';
		options.idColumnDefine = "fID";
		options.idColumnName = "fID";
		options.isTree = false;
		options.parentRelation = 'fParent';
		options.nodeKindRelation = 'nodeKind';
		options.nodeLevelRelation = 'nodeLevel';
		options.pathRelation = 'fID';
		options.directDeleteMode = true;
		options.limit = 15;
		options.orderBy = "ItemBatch.itemNo ASC";
		//聚合列
//		options.aggregateColumns = {"StorageItem.quantityL":{name:"sumQuantityL",type:"Decimal",label:""},"CONVERT(FileItem.costingAmountPer*StorageItem.quantityL,decimal(38,2))":{name:"sumCostingAmount",type:"Decimal",label:""},"StorageItem.pieceQuantityL":{name:"sumPieceQuantityL",type:"Decimal",label:""}};
		
		Model.dataMaster = new BizData(options);

		//监视对象中的所有变动
//		Model.dataMaster.deregRows = $scope.$watch('Model.dataMaster.rows',Model.dataMaster.watchRows,true);//true代表深度监视，包括对象的属性，而不是简单的一个值
		//////////////////////////////////////////////

		//设置过滤条件
//		Model.dataMaster.filter = "StorageItem.batchNo<>'********************'";

		//刷新数据
	    Model.dataMaster.refreshData();
//	    console.log('Model.dataMaster-->',Model.dataMaster.reader);
		////////////////////启动执行结束///////////////////////////////////////////////////
	    
		Model.refresh = function(){
			Model.dataMaster.refreshData();
		}
		
	    return Model;
		
	}	
	
